<template>
  <div class="form">
    <el-form ref="form" :model="form" label-width="80px">
      <el-form-item label="手机号">
        <el-input v-model="form.mobile" placeholder="请输入手机号"></el-input>
      </el-form-item>
      <el-form-item label="密码" v-if="!form.id">
        <el-input
          v-model="form.pwd"
          type="password"
          placeholder="请输入密码"
        ></el-input>
      </el-form-item>

      <!-- <el-form-item label="性别">
        <el-select v-model="form.sex" placeholder="请选择性别">
          <el-option label="男" value="1"></el-option>
          <el-option label="女" value="0"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="账号类型">
          <el-select v-model="form.account_type" placeholder="请选择账号类型">
            <el-option label="用户" value="0"></el-option>
            <el-option label="平台工作人员" value="1"></el-option>
          </el-select>
      </el-form-item> -->
    </el-form>
  </div>
</template>

<script>
export default {
  name:'user-form',
  props: {
    userdata: {
      type: Object,
      default: () => {
        return {};
      },
    },
  },
  data() {
    return {
      form: {
        id: "",
        account_type: "",
        accout: "",
        alipay: "",
        birth: "",
        create_time: "",
        dy: "",
        headicon: "",
        mail: "",
        mobile: "",
        nickname: "",
        pwd: "",
        sex: 1,
        user_name: "",
        wb: "",
        wx: "",
      },
    };
  },
  watch: {
    userdata() {
      this.form = this.userdata;
    },
  },
  methods: {
    getForm() {
      return this.form;
    },
  },
};
</script>

<style lang="scss">
.form {
  text-align: left;
  .el-input {
    width: 240px;
  }
}
</style>